<?php
namespace app\backstage\validate;
use think\Validate;

class Feature extends Validate
{
    protected $rule = [
        'id'                => 'require|gt:0',
        'version'           => 'require',
        'download_path'     => 'require',
        'quick_id'          => 'require|gt:0',
    ];

    protected $message  =   [
        'id.require'            => '版本信息ID不能为空',
        'id.gt'                 => '版本信息ID不能为空',
        'version.require'       => '版本号不能为空',
        'download_path.require' => '请上传功能包',
        'quick_id.require'      => '请选择应用',
        'quick_id.gt'           => '请选择应用',
    ];

    protected $scene = [
        'add'   => ['quick_id'],
        'edit'  => ['id','quick_id'],
        'info'  => ['id'],
    ];
}